<template>
	<view style="padding-bottom: 142rpx;">
		<view class="header">
			<u-navbar title="车次详情" back-icon-size='44' :background="background" title-color="#FFFFFF"
				:border-bottom='false' back-icon-color='#071D42'>
				<view slot='right' style="padding-right: 32rpx;">
					<u-icon name="reload" color="#FFFFFF" size="44"></u-icon>
				</view>
			</u-navbar>
		</view>

		<view class="container">
			<view class="top">
				<view class="date">
					02-10 <text style="font-size: 28rpx;font-weight: 400;margin-left: 8rpx;">周三出发</text>
				</view>
				<view class="long">
					全程7时34分
				</view>
			</view>
			<view class="transferBox">
				<view class="step-one">
					<view class="num">
						1
					</view>
					<view class="trainNum">
						<text>02-10出发</text><text style="margin-left: 20rpx;">G9656</text>
					</view>
					<view class="stop" @click="navTo('./stopInfo')">
						<u-icon name="map-fill" color="#8594B1" size="28"></u-icon>
						<text>经停信息</text>
					</view>
				</view>
				<view class="step-two">
					<view class="line">
						<view class="circle"></view>
						<view class="dash"></view>
						<view class="circle"></view>
					</view>
					<view class="time">
						<view class="start">
							<text>11:00</text>
							<text class="station">深圳东站</text>
						</view>
						<view class="end" style="margin-top: 10rpx;">
							<text>16:30</text>
							<text class="station">长沙南站</text>
						</view>
					</view>
				</view>
				
				<view class="exchange">
					<view class="left">
						中 转
					</view>
					<view class="right">
						<view class="topTit">
							<text style="color: #333333;margin-right: 6rpx;">换乘至</text><text>长沙站</text>
						</view>
						<view class="botTit">
							长沙南中转，转乘火车，请在1时52分内换乘
						</view>
					</view>
				</view>
				
				<view class="step-one">
					<view class="num">
						2
					</view>
					<view class="trainNum">
						<text>02-10出发</text><text style="margin-left: 20rpx;">K2369</text>
					</view>
					<view class="stop" @click="navTo('./stopInfo')">
						<u-icon name="map-fill" color="#8594B1" size="28"></u-icon>
						<text>经停信息</text>
					</view>
				</view>
				<view class="step-two">
					<view class="line">
						<view class="circle"></view>
						<view class="dash"></view>
						<view class="circle"></view>
					</view>
					<view class="time">
						<view class="start">
							<text>18:00</text>
							<text class="station">长沙站</text>
						</view>
						<view class="end" style="margin-top: 10rpx;">
							<text>20:30</text>
							<text class="station">常德站</text>
						</view>
					</view>
				</view>
				
			</view>

		</view>
		
		<view class="seat">
			<view class="seat-ul">
				<view class="label">
					第一程
				</view>
				<view class="seat-li">
					<view class="item" :style="{background:checked?'url(../../../static/imgs/hcpxz.png) no-repeat':'#FFFFFF'}" @click="chooseOne">
						<view class="type" :style="{color:checked?'#3587F7':'#666666'}">
							二等座
						</view>
						<view class="price" :style="{color:checked?'#3587F7':'#666666'}">
							¥269.2
						</view>
						<view class="status" :style="{color:checked?'#3587F7':'#666666'}">
							有票
						</view>
					</view>
					<view class="item">
						<view class="type">
							一等座
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
					</view>
					<view class="item">
						<view class="type">
							商务座
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
					</view>
				</view>
			</view>
			<view class="seat-ul">
				<view class="label">
					第二程
				</view>
				<view class="seat-li">
					<view class="item">
						<view class="type">
							硬座
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
					</view>
					<view class="item">
						<view class="type">
							硬卧
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
						
					</view>
					<view class="item">
						<view class="type">
							软卧
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
						
					</view>
					<view class="item">
						<view class="type">
							无座
						</view>
						<view class="price">
							¥269.2
						</view>
						<view class="status">
							有票
						</view>
						
					</view>
				</view>
			</view>
		</view>
		
		<view class="exchangeTip" @click="navTo('./transInfo')">
			<u-icon name="error-circle" color="#4A6897" size="28"></u-icon>
			<text>中转预定须知</text>
		</view>
		
		<view class="payment">
			<view class="left">
				<view class="text">
					单人票价
				</view>
				<view class="price">
					<text style="font-weight: normal;font-size: 28rpx;">¥</text>569
				</view>
				<view class="tool" @click="showMask=true">
					<u-icon name="arrow-up" color="#999999" size="28"></u-icon>
				</view>
			</view>
			<view class="next" @click="navTo('./transOrder')">
				下一步
			</view>
		</view>
		
		<u-popup v-model="showMask" mode="bottom" closeable border-radius="16">
			<view class="detailBox">
				<view class="title">
					价格明细
				</view>
				<view class="detail-item">
					<view class="left">
						第1程票价
					</view>
					<view class="right">
						¥569
					</view>
				</view>
				<view class="detail-item">
					<view class="left">
						第2程票价
					</view>
					<view class="right">
						¥569
					</view>
				</view>
			</view>
		</u-popup>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showMask:false,
				background: {
					backgroundColor: 'rgba(255,255,255,0)'
				},
				checked:false,
			}
		},
		onPageScroll(e) {
			if(e.scrollTop > 30) {
				this.background.backgroundColor = 'rgba(61, 164, 254, 1)'
			}else {
				this.background.backgroundColor = 'rgba(255,255,255,0)'
			}
		},
		methods:{
			chooseOne(index) {
				this.checked = !this.checked
			},
			navTo(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.header {
		width: 100%;
		height: 606rpx;
		background: linear-gradient(180deg, #3DA4FE 0%, #3587F7 74%, rgba(45, 123, 247, 0) 100%);
	}

	.container {
		margin-top: -500rpx;
		padding: 0 28rpx;

		.top {
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #FFFFFF;

			.date {
				font-size: 36rpx;
				font-family: Segoe UI;
				font-weight: bold;
			}

			.long {
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
			}
		}

		.transferBox {
			margin-top: 20rpx;
			width: 694rpx;
			height: auto;
			background: #FFFFFF;
			border-radius: 16rpx;
			padding:20rpx;
			
			.exchange {
				margin: 20rpx 0 10rpx;
				display: flex;
				align-items: center;
				.left {
					width: 40rpx;
					height: 80rpx;
					background: #9DACC9;
					border-radius: 4rpx;
					font-size: 24rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #FFFFFF;
					text-align: center;
					line-height: 40rpx;
				}
				.right {
					width: 614rpx;
					height: 80rpx;
					background: linear-gradient(270deg, #FFFFFF 0%, #EFF1FD 100%);
					padding-left: 10rpx;
					display: flex;
					flex-direction: column;
					justify-content: center;
					.topTit {
						font-size: 24rpx;
						font-family: Segoe UI;
						font-weight: 400;
						color: #3587F7;
					}
					.botTit {
						font-size: 20rpx;
						font-family: Segoe UI;
						font-weight: 400;
						color: #999999;
					}
				}
			}
			
			.step-one {
				width: 100%;
				height: 100rpx;
				display: flex;
				align-items: center;

				.num {
					width: 32rpx;
					height: 32rpx;
					background: #9DACC9;
					border-radius: 4rpx;
					font-size: 20rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #FFFFFF;
					text-align: center;
					line-height: 32rpx;
				}

				.trainNum {
					font-size: 24rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #666666;
					margin-left: 20rpx;
				}

				.stop {
					margin-left: auto;
					font-size: 12px;
					font-family: Segoe UI;
					font-weight: 400;
					line-height: 14px;
					color: #8594B1;
				}
			}

			.step-two {
				display: flex;
				align-items: center;

				.line {
					width: 10rpx;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					margin-left: 4rpx;

					.circle {
						width: 10rpx;
						height: 10rpx;
						background: #DFE3EC;
						border-radius: 50%;
					}

					.dash {
						width: 2rpx;
						height: 48rpx;
						background: #DFE3EC;
					}
				}

				.time {
					margin-left: 32rpx;
					.start,
					.end {
						font-size: 32rpx;
						font-family: Alibaba Sans;
						font-weight: bold;
						color: #333333;
						.station {
							margin-left: 32rpx;
						}
					}
				}
			}
		}
	}

	.seat {
		width: 694rpx;
		height: auto;
		background: #FFFFFF;
		border-radius: 16rpx;
		margin: 16rpx auto 0;
		.seat-ul {
			padding: 0 20rpx;
			.label {
				width: 100%;
				height: 80rpx;
				line-height: 80rpx;
			}
			.seat-li {
				display: flex;
				flex-wrap: wrap;
				.item {
					width: 208rpx;
					height: 156rpx;
					border: 2rpx solid #DFDEE2;
					border-radius: 8rpx;
					margin-right: 15rpx;
					margin-bottom: 15rpx;
					background-size: 100% 100% !important;
					&:nth-child(3n) {
						margin-right:0rpx;
					}
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					.type {
						font-size: 28rpx;
						font-family: Segoe UI;
						font-weight: 400;
						color: #666666;
					}
					.price {
						margin: 6rpx 0;
					}
					.price,
					.status{
						font-size: 24rpx;
						font-family: Segoe UI;
						font-weight: 400;
						color: #666666;
					}
				}
			}
		}
	}
	
	.exchangeTip {
		margin-top: 24rpx;
		padding-left: 42rpx;
		width: 100%;
		font-size: 24rpx;
		font-family: Segoe UI;
		font-weight: 400;
		color: #4A6897;
	}
		
	.payment {
		width: 100%;
		height: 112rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		display: flex;
		align-items: center;
		padding: 0 28rpx;
		z-index: 1000;
		.left {
			display: flex;
			align-items: center;
			.text {
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #333333;
			}
			.price {
				margin-left: 8rpx;
				font-size: 44rpx;
				font-family: Segoe UI;
				font-weight: bold;
				color: #F57426;
			}
			.tool {
				margin-left: 8rpx;
			}
		}
		.next {
			width: 220rpx;
			height: 80rpx;
			background: linear-gradient(180deg, #FEA837 0%, #FF7700 100%);
			border-radius: 8rpx;
			font-size: 32rpx;
			font-family: Segoe UI;
			font-weight: 400;
			line-height: 80rpx;
			color: #FFFFFF;
			text-align: center;
			margin-left: auto;
		}
	}

	.detailBox {
		padding: 0 28rpx;
		.title {
			width: 100%;
			height: 88rpx;
			font-size: 32rpx;
			font-family: Segoe UI;
			font-weight: bold;
			color: #333333;
			line-height: 88rpx;
		}
		.detail-item {
			width: 100%;
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.left {
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #333333;
			}
			.right {
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #F57426;
			}
		}
	}
</style>
